for i in 1 ... 11 {
    moveForward()
    
    if isBlocked && isBlockedRight {
        turnLeft()
    }
    
    if !isBlocked && !isOnGem {
        turnRight()
    }
    
    if isOnGem {
        collectGem()
    }
}